Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve build from source instructions #89

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

sef43
Copy link

@sef43 sef43 commented Nov 11, 2022

Address #64

  • Provides a conda environment file
  • update build instructions in README

* provide a conda environment

* update build instructions in README
README.md Outdated
- Minconda https://docs.conda.io/en/latest/miniconda.html#linux-installers
- CUDA Toolkit https://developer.nvidia.com/cuda-downloads
- LibTorch which is the PyTorch C++ API, by following the instructions at https://pytorch.org/cppdocs/installing.html and https://pytorch.org.
- to get a version for CUDA 1.16 used in our build example we use the commands:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, don't use stuff from pytorch.org. Their binaries are incompatible with conda-forge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to reconsider the build process and possibly make corresponding changes to the CMake script. If you set TORCH_DIR (not PYTORCH_DIR) to the directory containing TorchConfig.cmake, it should be able to automatically find everything it needs.

environment.yaml Outdated
@@ -0,0 +1,7 @@
channels:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md Outdated Show resolved Hide resolved
@raimis raimis linked an issue Nov 11, 2022 that may be closed by this pull request
README.md Outdated

1. Create a directory in which to build the plugin.
- Minconda https://docs.conda.io/en/latest/miniconda.html#linux-installers
- CUDA Toolkit https://developer.nvidia.com/cuda-downloads
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CUDA is only needed if you have a NVIDIA GPU you want to use with it.

@peastman
Copy link
Member

These instructions seem to be Linux specific. We also support Mac and Windows. Note that conda-forge does not currently provide PyTorch builds for WIndows, so in that case it's necessary to get it from the PyTorch website or the pytorch conda channel.

* Separate instructions for linux, linux with cuda, and MacOS

* conda environment files for each build
@sef43
Copy link
Author

sef43 commented Nov 14, 2022

I have made specific instructions for Linux (with and without CUDA) and MacOS.
One issue is that I think the conda-forge NNPOps only has linux with cuda versions available

@raimis
Copy link
Contributor

raimis commented Nov 14, 2022

We should put the from-source installation instructions to a separate file (e.g. INSTALL.md) and link it from the main READM.md. Most users can install with conda, so they don't need to be distracted.

@peastman
Copy link
Member

One issue is that I think the conda-forge NNPOps only has linux with cuda versions available

That's because conda-forge doesn't provide PyTorch builds for Windows. That makes building from source especially important, since it's the only option for Windows.

@sef43
Copy link
Author

sef43 commented Nov 17, 2022

For instructions for a building on Windows we will need to update PythonInstall and python/setup.py etc to work with windows. I am not familiar enough with the build system/Windows to do this.

I have been able to compile the c++ code on Windows (CPU only) using visual studio and this environment:

name: build
channels:
  - conda-forge
  - pytorch
dependencies:
  - openmm >=7.7
  - pip
  - pytest
  - python
  - pytorch::pytorch
  - pytorch::cpuonly 
  - swig <4.1

One quirk is that pytorch requires MKL, but the conda mkl for me did not seem to have all the files needed to compile so I had to download the full MKL installer from intel.

@sef43 sef43 mentioned this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve the installation instruction from source
3 participants